package com.webapi.controller;

import com.tinckay.entity.AccountA;
import com.webapi.common.core.Result;
import com.tinckay.dubbo.ADubboService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
* Created by Jean on 2019/06/27.
*/
@RestController
@RequestMapping("/account")
public class AccountController {


    /**
     * dubbo测试
     */
    @Resource
    ADubboService aDubboService;

    /**
     * 流程web请求-->ADubbo---->BDubbo--->返回web信息
     */
    @GetMapping("/test")
    public Result test(){
        AccountA account = new AccountA();
        account.setMoney(100);
        account.setUserId("110");
        String result = aDubboService.save(account);
        System.out.println(result);

        Result re = new Result();
        re.setMessage(result);
        return re;
    }
}
